package com.ljq.polymorphism;

/**
 * Description: 狗
 * Author: A
 * Date: 2025/2/24
 * Time: 16:04
 */
public class Dog extends Animal{
    String name = "狗"; // 子类成员变量
    @Override
    void makeSound() {
        super.makeSound();
        System.out.println("汪汪");
    }

    // 子类特有的方法
    void fetch() {
        System.out.println("狗狗正在捡球!");
    }
}
